package com.gavin.consume.consume.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: Gavin
 * Description: 在HelloRemote类添加指定fallback类，在服务熔断的时候返回fallback类中的内容， 定义容错的处理类，当调用远程接口失败或超时时，会调用对应接口的容错逻辑，fallback指定的类必须实现@FeignClient标记的接口
 * Date: 2019/1/16 Time: 12:45
 * Zhan Hong Copyright (c) 2018 All Rights Reserved.
 **/
@FeignClient(name= "spring-cloud-producer2" ,fallback = HelloRemoteHystrix.class)
public interface HelloRemote {
    @RequestMapping(value = "/hello")
    String hello2(@RequestParam(value = "name") String name);

    @RequestMapping(value = "/hello1")
    String hello1(@RequestParam(value = "name") String name);
}
